package jc.malpractice.controllers;
import jc.malpractice.service.AdminService;
import spark.Route;
import static spark.Spark.*;

public class AdminController {
    static  Route partselect1 = (request, response) -> {
        String event_code=request.raw().getParameter("event_code");
        String status = request.raw().getParameter("status");
        String dept_name = request.raw().getParameter("dept_name");
        String report_date = request.raw().getParameter("report_date");
        String reporter = request.raw().getParameter("reporter");
        System.out.println(event_code);
        System.out.println(status);
        System.out.println(dept_name);
        System.out.println(report_date);
        System.out.println(reporter);
        return AdminService.partselect1(event_code,status,dept_name,report_date,reporter);
    };
    static Route select1 = (request, response) -> {
        String event_code = request.raw().getParameter("event_code");
        return AdminService.select(event_code);
    };
    public static void Init() {
        System.out.println("chek 1");
        get("/admin/ALL",AdminController.select1);
        get("/admin/part",AdminController.partselect1);
    }
}
